package com.ap.core.domain;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDateTime;

import com.ap.core.common.types.SystemTypeCode;

/**
 * User: Rohit.Dixit
 */
@Entity
@Table(name = "T_ENDPOINT_ROUTING")
@AttributeOverride(name = "id",column = @Column(name = "ENDPOINT_ROUTING_ID"))
@TypeDef(name = "id", typeClass = Long.class)

public class EndPointRouting extends Identifiable<Long> {

    private static final long serialVersionUID = -747892374897239847L;
    
    @Column(name = "OPERATION_NAME")
    private String operationName;
    
    @Column(name = "DESTINATION_ID")
    private String destinationId;
    
    @Column(name = "DESTINATION_TYPE")
    @Enumerated(EnumType.STRING)
    private SystemTypeCode destinationType;
    

    @Column(name = "DESTINATION_NAME")
    private String destinationName;
    
   

    @Column(name = "DESTINATION_SERVICE")
    private String destinationService;
    


    @Column(name = "DESTINATION_URI")
    private String destinationUri;

    
    @Column(name = "last_update_tmstmp")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime lastUpdateTimestmp;



    private  EndPointRouting(){

    }

   



  

	public String getOperationName() {
		return operationName;
	}

	public String getDestinationId() {
		return destinationId;
	}

	public SystemTypeCode getDestinationType() {
		return destinationType;
	}

	public String getDestinationName() {
		return destinationName;
	}

	public String getDestinationService() {
		return destinationService;
	}

	public String getDestinationUri() {
		return destinationUri;
	}

	public LocalDateTime getLastUpdateTimestmp() {
		return lastUpdateTimestmp;
	}

	
	/* (non-Javadoc)
         * @see java.lang.Object#toString()
         */
	@Override
	public String toString() {
		return "EndPointRouting [id=" + id
				+ ", operationName="
				+ operationName + ",destinationId=" + destinationId
				+ ", destinationType="
				+ destinationType 
				+ ", destinationName=" + destinationName + ", destinationService="
				+ destinationService + ", destinationUri="
				+ destinationUri 
				+ ", lastUpdateTimestmp=" + lastUpdateTimestmp
				+ "]";
	}
    
    
}
